home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 14 / CU Amiga Magazine's Super CD-ROM 14 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-09].iso / CUCD / Programming / Mesa-2.2 / include / GL / glu.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-19  |  10.8 KB  |  389 lines

  1. /* $Id: glu.h,v 1.4 1997/02/19 10:13:54 brianp Exp $ */
  2.  
  3. /*
  4.  * Mesa 3-D graphics library
  5.  * Version:  2.2
  6.  * Copyright (C) 1995-1997  Brian Paul
  7.  *
  8.  * This library is free software; you can redistribute it and/or
  9.  * modify it under the terms of the GNU Library General Public
  10.  * License as published by the Free Software Foundation; either
  11.  * version 2 of the License, or (at your option) any later version.
  12.  *
  13.  * This library is distributed in the hope that it will be useful,
  14.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  16.  * Library General Public License for more details.
  17.  *
  18.  * You should have received a copy of the GNU Library General Public
  19.  * License along with this library; if not, write to the Free
  20.  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  */
  22.  
  23.  
  24. /*
  25.  * $Log: glu.h,v $
  26.  * Revision 1.4  1997/02/19 10:13:54  brianp
  27.  * now test for __QUICKDRAW__ like for __BEOS__ (Randy Frank)
  28.  *
  29.  * Revision 1.3  1997/02/03 20:05:33  brianp
  30.  * patches for BeOS
  31.  *
  32.  * Revision 1.2  1997/02/03 19:15:15  brianp
  33.  * conditionally include glu_mangle.h
  34.  *
  35.  * Revision 1.1  1996/09/13 01:26:41  brianp
  36.  * Initial revision
  37.  *
  38.  */
  39.  
  40.  
  41. #ifndef GLU_H
  42. #define GLU_H
  43.  
  44.  
  45. #if defined(USE_MGL_NAMESPACE)
  46. #include "glu_mangle.h"
  47. #endif
  48.  
  49.  
  50. #ifdef __cplusplus
  51. extern "C" {
  52. #endif
  53.  
  54.  
  55. #include "GL/gl.h"
  56.  
  57.  
  58. #define GLU_VERSION_1_1        1
  59.  
  60.  
  61. #define GLU_TRUE   GL_TRUE
  62. #define GLU_FALSE  GL_FALSE
  63.  
  64.  
  65. enum {
  66.     /* Normal vectors */
  67.     GLU_SMOOTH    = 100000,
  68.     GLU_FLAT    = 100001,
  69.     GLU_NONE    = 100002,
  70.  
  71.     /* Quadric draw styles */
  72.     GLU_POINT    = 100010,
  73.     GLU_LINE    = 100011,
  74.     GLU_FILL    = 100012,
  75.     GLU_SILHOUETTE    = 100013,
  76.  
  77.     /* Quadric orientation */
  78.     GLU_OUTSIDE    = 100020,
  79.     GLU_INSIDE    = 100021,
  80.  
  81.     /* Tesselator */
  82.     GLU_BEGIN    = 100100,
  83.     GLU_VERTEX    = 100101,
  84.     GLU_END        = 100102,
  85.     GLU_ERROR    = 100103,
  86.     GLU_EDGE_FLAG    = 100104,
  87.  
  88.     /* Contour types */
  89.     GLU_CW        = 100120,
  90.     GLU_CCW        = 100121,
  91.     GLU_INTERIOR    = 100122,
  92.     GLU_EXTERIOR    = 100123,
  93.     GLU_UNKNOWN    = 100124,
  94.  
  95.     /* Tesselation errors */
  96.     GLU_TESS_ERROR1    = 100151,  /* missing gluEndPolygon */
  97.     GLU_TESS_ERROR2 = 100152,  /* missing gluBeginPolygon */
  98.     GLU_TESS_ERROR3 = 100153,  /* misoriented contour */
  99.     GLU_TESS_ERROR4 = 100154,  /* vertex/edge intersection */
  100.     GLU_TESS_ERROR5 = 100155,  /* misoriented or self-intersecting loops */
  101.     GLU_TESS_ERROR6 = 100156,  /* coincident vertices */
  102.     GLU_TESS_ERROR7 = 100157,  /* all vertices collinear */
  103.     GLU_TESS_ERROR8 = 100158,  /* intersecting edges */
  104.     GLU_TESS_ERROR9 = 100159,  /* not coplanar contours */
  105.  
  106.     /* NURBS */
  107.     GLU_AUTO_LOAD_MATRIX    = 100200,
  108.     GLU_CULLING        = 100201,
  109.     GLU_PARAMETRIC_TOLERANCE= 100202,
  110.     GLU_SAMPLING_TOLERANCE    = 100203,
  111.     GLU_DISPLAY_MODE    = 100204,
  112.     GLU_SAMPLING_METHOD    = 100205,
  113.     GLU_U_STEP        = 100206,
  114.     GLU_V_STEP        = 100207,
  115.  
  116.     GLU_PATH_LENGTH        = 100215,
  117.     GLU_PARAMETRIC_ERROR    = 100216,
  118.     GLU_DOMAIN_DISTANCE    = 100217,
  119.  
  120.     GLU_MAP1_TRIM_2        = 100210,
  121.     GLU_MAP1_TRIM_3        = 100211,
  122.  
  123.     GLU_OUTLINE_POLYGON    = 100240,
  124.     GLU_OUTLINE_PATCH    = 100241,
  125.  
  126.     GLU_NURBS_ERROR1  = 100251,   /* spline order un-supported */
  127.     GLU_NURBS_ERROR2  = 100252,   /* too few knots */
  128.     GLU_NURBS_ERROR3  = 100253,   /* valid knot range is empty */
  129.     GLU_NURBS_ERROR4  = 100254,   /* decreasing knot sequence */
  130.     GLU_NURBS_ERROR5  = 100255,   /* knot multiplicity > spline order */
  131.     GLU_NURBS_ERROR6  = 100256,   /* endcurve() must follow bgncurve() */
  132.     GLU_NURBS_ERROR7  = 100257,   /* bgncurve() must precede endcurve() */
  133.     GLU_NURBS_ERROR8  = 100258,   /* ctrlarray or knot vector is NULL */
  134.     GLU_NURBS_ERROR9  = 100259,   /* can't draw pwlcurves */
  135.     GLU_NURBS_ERROR10 = 100260,   /* missing gluNurbsCurve() */
  136.     GLU_NURBS_ERROR11 = 100261,   /* missing gluNurbsSurface() */
  137.     GLU_NURBS_ERROR12 = 100262,   /* endtrim() must precede endsurface() */
  138.     GLU_NURBS_ERROR13 = 100263,   /* bgnsurface() must precede endsurface() */
  139.     GLU_NURBS_ERROR14 = 100264,   /* curve of improper type passed as trim curve */
  140.     GLU_NURBS_ERROR15 = 100265,   /* bgnsurface() must precede bgntrim() */
  141.     GLU_NURBS_ERROR16 = 100266,   /* endtrim() must follow bgntrim() */
  142.     GLU_NURBS_ERROR17 = 100267,   /* bgntrim() must precede endtrim()*/
  143.     GLU_NURBS_ERROR18 = 100268,   /* invalid or missing trim curve*/
  144.     GLU_NURBS_ERROR19 = 100269,   /* bgntrim() must precede pwlcurve() */
  145.     GLU_NURBS_ERROR20 = 100270,   /* pwlcurve referenced twice*/
  146.     GLU_NURBS_ERROR21 = 100271,   /* pwlcurve and nurbscurve mixed */
  147.     GLU_NURBS_ERROR22 = 100272,   /* improper usage of trim data type */
  148.     GLU_NURBS_ERROR23 = 100273,   /* nurbscurve referenced twice */
  149.     GLU_NURBS_ERROR24 = 100274,   /* nurbscurve and pwlcurve mixed */
  150.     GLU_NURBS_ERROR25 = 100275,   /* nurbssurface referenced twice */
  151.     GLU_NURBS_ERROR26 = 100276,   /* invalid property */
  152.     GLU_NURBS_ERROR27 = 100277,   /* endsurface() must follow bgnsurface() */
  153.     GLU_NURBS_ERROR28 = 100278,   /* intersecting or misoriented trim curves */
  154.     GLU_NURBS_ERROR29 = 100279,   /* intersecting trim curves */
  155.     GLU_NURBS_ERROR30 = 100280,   /* UNUSED */
  156.     GLU_NURBS_ERROR31 = 100281,   /* unconnected trim curves */
  157.     GLU_NURBS_ERROR32 = 100282,   /* unknown knot error */
  158.     GLU_NURBS_ERROR33 = 100283,   /* negative vertex count encountered */
  159.     GLU_NURBS_ERROR34 = 100284,   /* negative byte-stride */
  160.     GLU_NURBS_ERROR35 = 100285,   /* unknown type descriptor */
  161.     GLU_NURBS_ERROR36 = 100286,   /* null control point reference */
  162.     GLU_NURBS_ERROR37 = 100287,   /* duplicate point on pwlcurve */
  163.  
  164.     /* Errors */
  165.     GLU_INVALID_ENUM        = 100900,
  166.     GLU_INVALID_VALUE        = 100901,
  167.     GLU_OUT_OF_MEMORY        = 100902,
  168.     GLU_INCOMPATIBLE_GL_VERSION    = 100903,
  169.  
  170.     /* New in GLU 1.1 */
  171.     GLU_VERSION    = 100800,
  172.     GLU_EXTENSIONS    = 100801
  173. };
  174.  
  175.  
  176. typedef struct GLUquadricObj GLUquadricObj;
  177.  
  178. typedef struct GLUtriangulatorObj GLUtriangulatorObj;
  179.  
  180. typedef struct GLUnurbsObj GLUnurbsObj;
  181.  
  182.  
  183.  
  184. #if defined(__BEOS__) || defined(__QUICKDRAW__)
  185. #pragma export on
  186. #endif
  187.  
  188.  
  189. /*
  190.  *
  191.  * Miscellaneous functions
  192.  *
  193.  */
  194.  
  195. extern void gluLookAt( GLdouble eyex, GLdouble eyey, GLdouble eyez,
  196.                GLdouble centerx, GLdouble centery, GLdouble centerz,
  197.                GLdouble upx, GLdouble upy, GLdouble upz );
  198.  
  199.  
  200. extern void gluOrtho2D( GLdouble left, GLdouble right,
  201.                 GLdouble bottom, GLdouble top );
  202.  
  203.  
  204. extern void gluPerspective( GLdouble fovy, GLdouble aspect,
  205.                 GLdouble zNear, GLdouble zFar );
  206.  
  207.  
  208. extern void gluPickMatrix( GLdouble x, GLdouble y,
  209.                GLdouble width, GLdouble height,
  210.                GLint viewport[4] );
  211.  
  212. extern GLint gluProject( GLdouble objx, GLdouble objy, GLdouble objz,
  213.                          const GLdouble modelMatrix[16],
  214.                          const GLdouble projMatrix[16],
  215.                          const GLint viewport[4],
  216.                          GLdouble *winx, GLdouble *winy, GLdouble *winz );
  217.  
  218. extern GLint gluUnProject( GLdouble winx, GLdouble winy, GLdouble winz,
  219.                            const GLdouble modelMatrix[16],
  220.                            const GLdouble projMatrix[16],
  221.                            const GLint viewport[4],
  222.                            GLdouble *objx, GLdouble *objy, GLdouble *objz );
  223.  
  224. extern const GLubyte* gluErrorString( GLenum errorCode );
  225.  
  226.  
  227.  
  228. /*
  229.  *
  230.  * Mipmapping and image scaling
  231.  *
  232.  */
  233.  
  234. extern GLint gluScaleImage( GLenum format,
  235.                             GLint widthin, GLint heightin,
  236.                             GLenum typein, const void *datain,
  237.                             GLint widthout, GLint heightout,
  238.                             GLenum typeout, void *dataout );
  239.  
  240. extern GLint gluBuild1DMipmaps( GLenum target, GLint components,
  241.                     GLint width, GLenum format,
  242.                     GLenum type, const void *data );
  243.  
  244. extern GLint gluBuild2DMipmaps( GLenum target, GLint components,
  245.                                 GLint width, GLint height, GLenum format,
  246.                                 GLenum type, const void *data );
  247.  
  248.  
  249.  
  250. /*
  251.  *
  252.  * Quadrics
  253.  *
  254.  */
  255.  
  256. extern GLUquadricObj *gluNewQuadric( void );
  257.  
  258. extern void gluDeleteQuadric( GLUquadricObj *state );
  259.  
  260. extern void gluQuadricDrawStyle( GLUquadricObj *quadObject,
  261.                  GLenum drawStyle );
  262.  
  263. extern void gluQuadricOrientation( GLUquadricObj *quadObject,
  264.                    GLenum orientation );
  265.  
  266. extern void gluQuadricNormals( GLUquadricObj *quadObject, GLenum normals );
  267.  
  268. extern void gluQuadricTexture( GLUquadricObj *quadObject,
  269.                    GLboolean textureCoords );
  270.  
  271. extern void gluQuadricCallback( GLUquadricObj *qobj,
  272.                     GLenum which, void (*fn)() );
  273.  
  274. extern void gluCylinder( GLUquadricObj *qobj,
  275.              GLdouble baseRadius,
  276.              GLdouble topRadius,
  277.              GLdouble height,
  278.              GLint slices, GLint stacks );
  279.  
  280. extern void gluSphere( GLUquadricObj *qobj,
  281.                GLdouble radius, GLint slices, GLint stacks );
  282.  
  283. extern void gluDisk( GLUquadricObj *qobj,
  284.              GLdouble innerRadius, GLdouble outerRadius,
  285.              GLint slices, GLint loops );
  286.  
  287. extern void gluPartialDisk( GLUquadricObj *qobj, GLdouble innerRadius,
  288.                 GLdouble outerRadius, GLint slices, GLint loops,
  289.                 GLdouble startAngle, GLdouble sweepAngle );
  290.  
  291.  
  292.  
  293. /*
  294.  *
  295.  * Nurbs
  296.  *
  297.  */
  298.  
  299. extern GLUnurbsObj *gluNewNurbsRenderer( void );
  300.  
  301. extern void gluDeleteNurbsRenderer( GLUnurbsObj *nobj );
  302.  
  303. extern void gluLoadSamplingMatrices( GLUnurbsObj *nobj,
  304.                      const GLfloat modelMatrix[16],
  305.                      const GLfloat projMatrix[16],
  306.                      const GLint viewport[4] );
  307.  
  308. extern void gluNurbsProperty( GLUnurbsObj *nobj, GLenum property,
  309.                   GLfloat value );
  310.  
  311. extern void gluGetNurbsProperty( GLUnurbsObj *nobj, GLenum property,
  312.                  GLfloat *value );
  313.  
  314. extern void gluBeginCurve( GLUnurbsObj *nobj );
  315.  
  316. extern void gluEndCurve( GLUnurbsObj * nobj );
  317.  
  318. extern void gluNurbsCurve( GLUnurbsObj *nobj, GLint nknots, GLfloat *knot,
  319.                GLint stride, GLfloat *ctlarray, GLint order,
  320.                GLenum type );
  321.  
  322. extern void gluBeginSurface( GLUnurbsObj *nobj );
  323.  
  324. extern void gluEndSurface( GLUnurbsObj * nobj );
  325.  
  326. extern void gluNurbsSurface( GLUnurbsObj *nobj,
  327.                  GLint sknot_count, GLfloat *sknot,
  328.                  GLint tknot_count, GLfloat *tknot,
  329.                  GLint s_stride, GLint t_stride,
  330.                  GLfloat *ctlarray,
  331.                  GLint sorder, GLint torder,
  332.                          GLenum type );
  333.  
  334. extern void gluBeginTrim( GLUnurbsObj *nobj );
  335.  
  336. extern void gluEndTrim( GLUnurbsObj *nobj );
  337.  
  338. extern void gluPwlCurve( GLUnurbsObj *nobj, GLint count, GLfloat *array,
  339.              GLint stride, GLenum type );
  340.  
  341. extern void gluNurbsCallback( GLUnurbsObj *nobj, GLenum which, void (*fn)() );
  342.  
  343.  
  344.  
  345. /*
  346.  *
  347.  * Polygon tesselation
  348.  *
  349.  */
  350.  
  351. extern GLUtriangulatorObj* gluNewTess( void );
  352.  
  353. extern void gluTessCallback( GLUtriangulatorObj *tobj, GLenum which,
  354.                   void (*fn)() );
  355.  
  356. extern void gluDeleteTess( GLUtriangulatorObj *tobj );
  357.  
  358. extern void gluBeginPolygon( GLUtriangulatorObj *tobj );
  359.  
  360. extern void gluEndPolygon( GLUtriangulatorObj *tobj );
  361.  
  362. extern void gluNextContour( GLUtriangulatorObj *tobj, GLenum type );
  363.  
  364. extern void gluTessVertex( GLUtriangulatorObj *tobj, GLdouble v[3],
  365.                void *data );
  366.  
  367.  
  368.  
  369. /*
  370.  *
  371.  * New functions in GLU 1.1
  372.  *
  373.  */
  374.  
  375. extern const GLubyte* gluGetString( GLenum name );
  376.  
  377.  
  378. #if defined(__BEOS__) || defined(__QUICKDRAW__)
  379. #pragma export off
  380. #endif
  381.  
  382.  
  383. #ifdef __cplusplus
  384. }
  385. #endif
  386.  
  387.  
  388. #endif
  389.